package com.chen.controller;

import com.chen.base.ResponseResult;
import com.chen.dto.RefundVoucherDto;
import com.chen.service.RetreatBillService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 退住账单
 * @author: ChenFY
 * @date: 2024/8/3
 */
@RestController
@RequestMapping("/retreat_bills")
public class RetreatBillController {

    @Resource
    private RetreatBillService retreatBillService;

    /**
     * 上传退款凭证
     * @param refundVoucherDto 用于上传退款凭证文件
     * @return
     */
    @PutMapping("/uploadRefundVoucher")
    public ResponseResult uploadRefundVoucher(@RequestBody RefundVoucherDto refundVoucherDto) {
        return retreatBillService.uploadRefundVoucher(refundVoucherDto);
    }

    /**
     * 上传退款凭证数据回显
     * @param retreatId id
     * @return
     */
    @GetMapping
    public ResponseResult getRetreatBill(Long retreatId){
        return retreatBillService.getRetreatBill(retreatId);
    }


}
